package com.zhs.gccs.adapter;

import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.zhs.gccs.R;
import com.zhs.gccs.model.GccsOfProject;
import com.zhs.gccs.model.GccsProblem;

/**
 * Created by chengzf on 2024/7/21.
 */
public class GccsReportProblemGridAdapter extends BaseQuickAdapter<GccsProblem, BaseViewHolder> {

    public GccsReportProblemGridAdapter() {
        super(R.layout.item_gccs_report_problem_view);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder holder, GccsProblem bean) {
        TextView tv_type = holder.getView(R.id.tv_type);
        LinearLayout il_item = holder.getView(R.id.il_item);
        if(bean.isSelected()){
            tv_type.setTextColor(mContext.getResources().getColor(R.color.white));
            il_item.setBackgroundResource(R.drawable.bg_light_blue_fill);
        }else {
            tv_type.setTextColor(mContext.getResources().getColor(R.color.app_them));
            il_item.setBackgroundResource(R.drawable.bg_light_blue);
        }
        tv_type.setText(bean.getName());
    }
}
